package com.bwf.pojo;

import com.bwf.service.IRepay;

/**
 * @version v1.0
 * @description:
 * @author: admin
 * @date: 2022/12/19 13:56
 * @copyright: 博为峰
 */
public class CreditAccount extends Account implements IRepay {
    /*
         隐含默认构造方法:
         public CreditAccount(){
            //隐式语句
            super();
         }
     */
    public double ceiling;

    public CreditAccount(String cardNo, String passwd, double balance) {
        super(cardNo, passwd, balance);
    }

    public CreditAccount(String cardNo, String passwd, double balance, double ceiling) {
        super(cardNo, passwd, balance);
        this.ceiling = ceiling;
    }

    @Override
    public void deposit(double money) {
        double balance = getBalance() + ceiling;
        balance = balance - money;
        setBalance(balance);
    }

    @Override
    public void loan() {

    }
}
